import {ADD_PERSON} from '../constant';

const init=[{id:'01',name:'张三',age:18}]
export default function ADDPERSON(preState=init,action){
    console.log('person reducer');
    const {type,data}=action
    switch (type) {
        case ADD_PERSON:
        
            return [data,...preState]
    
        default:
            return preState
    }

}